<!--
	作者：779744514@qq.com
	时间：2015-08-18
	描述：有问题
-->
<!DOCTYPE html>
<html ng-app="myApp">
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div ng-controller="MyController">
			<input ng-model="to" type="email" placeholder=Recipient />
			<textarea ng-model="emailBody"></textarea>
			<pre>{{previewText}}</pre>
		</div>
		<script src="js/angular.js"></script>
		<script type="text/javascript">
			angular.module('myApp',[])
				.controller('MyController',function($scope,$interpolate){
					//设置监听
					$scope.$watch('emailBody',function(body){
						if(body){
							var template=$interpolate(body);
							$scope.previewText=
							template({to:$scope.to});
						}
					});
				});
		</script>
	</body>
</html>
